<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">


  <title>登陆</title>
</head>
<body>
<header>用户登录</header>
<div class="login_inner">

  <!--登录错误提示消息-->
  <div id="errorMsg" class="alert alert-danger"></div>
  <form id="loginForm" action="/web/loginservlet/teaLogin" method="post" accept-charset="utf-8">
    <input type="hidden" name="action" value="login"/>
    <input name="username" type="text" placeholder="请输入账号" autocomplete="off">
    <input name="password" type="text" placeholder="请输入密码" autocomplete="off">
    <input name="newpassword" type="text" placeholder="请输入新密码" autocomplete="off">
    <input name="coursename" type="text" placeholder="查询的课程名" autocomplete="off">
    <div class="verify">

    </div>
    <div class="submit_btn">
      <button type="button" id="btn_sub">登录</button>
      <button type="button" id="btn_test">显示</button>
      <button type="button" id="btn_search">查询课程</button>
      <button type="button" id="btn_changePassword">修改</button>
      <button type="button" id="btn_searchCourse">查课</button>
      <button type="button" id="btn_gradeAnalysis">成绩分析</button>
      <div class="auto_login">
        <input type="checkbox" name="" class="checkbox">
        <span>自动登录</span>
      </div>
    </div>
  </form>
  <div class="reg">没有账户？<a href="welcome.html">立即注册</a></div>
</div>
<script src="js/jquery-3.3.1.js"></script>
<script src="js/jquery-1.11.0.min.js"></script>

<script src="js/bootstrap.min.js"></script>
<script>
  $(function () {
    $("#btn_sub").click(function () {
      $.post("loginservlet/teaLogin", $("#loginForm").serialize(), function (data) {
        $("#errorMsg").html(data.errorMsg);
      })
    })
    $("#btn_test").click(function () {
      $.post("menuservlet/teaMenu", $("#loginForm").serialize(), function (data) {
        $("#errorMsg").html(data.errorMsg);
      })
    })
    $("#btn_search").click(function () {
      $.post("ScoreSearchServlet/ScoreSearch",$("#loginForm").serialize(), function (data) {
        $("#errorMsg").html(data.errorMsg);
      })
    })
    $("#btn_changePassword").click(function () {
      $.post("loginservlet/teaChangePwd",$("#loginForm").serialize(), function (data) {
        $("#errorMsg").html(data.errorMsg);
      })
    })
    $("#btn_searchCourse").click(function () {
      $.post("CourseChooseServlet/GetCourse", $("#loginForm").serialize(), function (data) {
        $("#errorMsg").html(data.errorMsg);
      })
    })
    $("#btn_gradeAnalysis").click(function (){
      $.post("searchservlet/teaGradeAnalysis", $("#loginForm").serialize(), function (data){
        $("#errorMsg").html(data.errorMsg);
      })
    })

  });
</script>
</body>
</html>